package com.cjgl.model.enums;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 用户类型枚举
 */
public enum UserTypeEnum {
	STUDENT("student", 1),
	TEACHER("teacher", 2),
	ADMIN("admin", 3);

	private final String type;

	private final int value;

	UserTypeEnum(String type, int value) {
		this.type = type;
		this.value = value;
	}

	/**
	 * 获取值列表
	 *
	 * @return
	 */
	public static List<Integer> getValues() {
		return Arrays.stream(values()).map(item -> item.value).collect(Collectors.toList());
	}

	public int getValue() {
		return value;
	}

	public String getType() {
		return type;
	}
}
